//mock数据模拟
import Mock from "mockjs"

//图标数据
let list = []
export default {
  getStatisticalData:() => {
    //Mock.Random.float 产生随机数100到8000之间，保留小数，最小0位，最大0位
    for (let i = 0; i < 7; i++){
      list.push(
        Mock.mock({
          Java:Mock.Random.float(100,8000,0,0),
          Python:Mock.Random.float(100,8000,0,0),
          C : Mock.Random.float(100,8000,0,0),
          go : Mock.Random.float(100,8000,0,0),
          rust : Mock.Random.float(100,8000,0,0),
        })
      )
    }
    return{
      code:2000,
      data:{
        //饼图
        videoData:[
          {
            name:"java",
            value:2999
          },
          {
            name:"python",
            value:1999
          },
          {
            name:"c",
            value:1000
          },
          {
            name:"rust",
            value:500
          },
        ],
        //柱状图
        userData:[
          {
            date:'周一',
            new:100,
            active:200
          },
          {
            date:'周二',
            new:120,
            active:250
          },
          {
            date:'周三',
            new:130,
            active:300
          },
          {
            date:'周四',
            new:200,
            active:430
          },
          {
            date:'周五',
            new:222,
            active:500
          },
        ],
        //折线图
        orderData:{
          date:['20221011','20221012','20221013','20221014','20221015'],
          data:list
        },
        tableData:[
          {
            name: "java",
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy:8000,
          },
          {
            name: "python",
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy:8000,
          },
          {
            name: "go",
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy:8000,
          },
          {
            name: "c",
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy:8000,
          },
          {
            name: "rust",
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy:8000,
          },
        ]
      }
    }
  }
}
